<?php 

/**
 * 用户管理控制器
 * @author 阿柱 <422852954@qq.com>
 */
class UserController extends AuthController{
    /**
     *   默认访问方法
     */
    public function index(){

    	$sql="SELECT * FROM hd_user";
		$userData=M()->query($sql);
		$this->assign('userData',$userData);
//		p($userData);
		
		
       $this->display('user_list.html'); 
    }
	
	public function lock(){
		$uid=(int)$_GET['uid'];
		$sql="SELECT * FROM hd_user WHERE uid={$uid}";
		$lockData=M()->query($sql);
		if($lockData[0]['lock']==0){
			$sql="UPDATE hd_user SET `lock`=1 WHERE uid={$uid}";
		}else{
			$sql="UPDATE hd_user SET `lock`=0 WHERE uid={$uid}";
		}
		M()->exec($sql);
		$this->error('锁定成功');
		
	}
 }
 

 
 
 
 
 
 





 ?>